package com.wmz.picture.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wmz.picture.model.dto.space.SpaceAddRequest;
import com.wmz.picture.model.dto.space.SpaceQueryRequest;
import com.wmz.picture.model.entity.Space;
import com.wmz.picture.model.entity.User;
import com.wmz.picture.model.vo.SpaceVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author 李鹤春
* @description 针对表【space(空间)】的数据库操作Service
* @createDate 2025-01-16 17:14:20
*/
public interface SpaceService extends IService<Space> {
    /**
     * 新增空间
     * @param spaceAddRequest   新增空间DTO
     * @param loginUser 登录用户
     * @return 创建的空间id
     */
    long addSpace(SpaceAddRequest spaceAddRequest, User loginUser);

    /**
     * 获取单个空间封装类
     *
     * @param space 原空间信息
     * @return
     */
    SpaceVO getSpaceVO(Space space);

    /**
     * 分页获取空间封装
     * @param spacePage
     * @param request
     * @return
     */
    Page<SpaceVO> getSpaceVOPage(Page<Space> spacePage, HttpServletRequest request);
    /**
     * 构造查询请求器
     * @param spaceQueryRequest 查询请求DTO
     * @return
     */
    QueryWrapper<Space> getQueryWrapper(SpaceQueryRequest spaceQueryRequest);

    /**
     * 空间校验
     * @param space
     */
    void validSpace(Space space, boolean add);


    /**
     * 补充审核参数
     * @param space 空间实体类
     */
    void fillSpaceBySpaceLevel(Space space);
}
